﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ERPStore.Extensions
{
	public static class DependencyResolverExtensions
	{
		public static TService GetService<TService>(this IOC.IDependencyResolver resolver)
		{
			return (TService)resolver.GetService(typeof(TService));
		}

		public static IEnumerable<TService> GetServices<TService>(this IOC.IDependencyResolver resolver)
		{
			return resolver.GetServices(typeof(TService)).Cast<TService>();
		}

		public static Microsoft.Practices.Unity.IUnityContainer GetContainer(this IOC.IDependencyResolver resolver)
		{
			return resolver.Container;
		}
	}
}
